<%@ include file="/common/taglibs.jsp"%>
<%@ page import="java.text.*" %>
<%@ page import="java.util.*" %>
<verFunc:verFuncValidate funcKey="report">
<title><fmt:message key="report.salesAmount.Statistic"/></title>
<head>
<script type="text/javascript" src="${ctxPath}/fusionCharts/JSClass/FusionCharts.js?rs=${appConfig.rs}"></script>
</head>
<%

java.util.Calendar calendar =  java.util.Calendar.getInstance();
request.setAttribute("currYear", calendar.get(java.util.Calendar.YEAR));
request.setAttribute("currMonth", calendar.get(java.util.Calendar.MONTH)+1);
java.util.Locale locale = null;
DateFormat df = new SimpleDateFormat("MMM",locale.ENGLISH);
SimpleDateFormat format= new SimpleDateFormat("MM");
String enMonth = df.format(new java.util.Date());
locale = request.getLocale();
request.setAttribute("locale",locale);
request.setAttribute("enMonth",enMonth);
%>
<content tag="buttons">
	<form id="reportForm" method="post" onkeypress="return keypressYearMonth(event, 'reportForm');">
		<div id="searchFormContent" class="cnt">
			<fmt:message key="report.date"/>:
			<select name="year" class="selecttxt" style="width:100px">
				<c:forEach var="yearStep" begin="0" end="${currYear-2000}">
					<option value="${currYear-yearStep}" <c:if test="${currYear eq yearStep}">selected="true"</c:if>>${currYear-yearStep}<fmt:message key="report.date.year"/></option>
				</c:forEach>
			</select>
			<select name="month" class="selecttxt" style="width:100px">
			<c:choose>
				<c:when test="${locale eq 'en'}">
				<%----------------start:月份(英版)-------------------%>
					<option value="1" <c:if test="${enMonth eq 'January'}">selected="true"</c:if>>January</option>
					<option value="2" <c:if test="${enMonth eq 'February'}">selected="true"</c:if>>February</option>
					<option value="3" <c:if test="${enMonth eq 'March'}">selected="true"</c:if>>March</option>
					<option value="4" <c:if test="${enMonth eq 'April'}">selected="true"</c:if>>April</option>
					<option value="5" <c:if test="${enMonth eq 'May'}">selected="true"</c:if>>May</option>
					<option value="6" <c:if test="${enMonth eq 'June'}">selected="true"</c:if>>June</option>
					<option value="7" <c:if test="${enMonth eq 'July'}">selected="true"</c:if>>July</option>
					<option value="8" <c:if test="${enMonth eq 'Aguest'}">selected="true"</c:if>>Aguest</option>
					<option value="9" <c:if test="${enMonth eq 'September'}">selected="true"</c:if>>September</option>
					<option value="10" <c:if test="${enMonth eq 'October'}">selected="true"</c:if>>October</option>
					<option value="11" <c:if test="${enMonth eq 'November'}">selected="true"</c:if>>November</option>
					<option value="12" <c:if test="${enMonth eq 'December'}">selected="true"</c:if>>December</option>
				<%-----------------end:月份(英版)------------------%>
				</c:when>
				<c:otherwise>
					<c:forEach var="monthStep" begin="1" end="12">
						<option value="${monthStep}" <c:if test="${currMonth eq monthStep}">selected="true"</c:if>>${monthStep}<fmt:message key="report.month"/></option>
					</c:forEach>
				</c:otherwise>
			</c:choose>
				
			</select>
			<span class="search_btn_box">
			<input class="search_btn" type="button" onclick="searchByMonth();searchByYear();" title="<fmt:message key="button.search"/>" alt="<fmt:message key="button.search"/>" />&nbsp;&nbsp;
			</span>
		</div>
	</form>
</content>

<div class="modify">
	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="com_modi_table">
		<tr>
			<td align="left">
				<span id="chartdiv">Loading...</span>
				<span id="chartdiv2">Loading...</span>
			</td>
		</tr>
	</table>
</div>
<%@include file="../report/include/productSalesRankMsgJs.jspf" %>
<script type="text/javascript" src="${ctxPath}/scripts/probiz/report/reportSearchKeyPress.js?rs=${appConfig.rs}"></script>

<script type="text/javascript">
$j(document).ready(function(){
	searchByMonth();
	searchByYear();
});
function searchByMonth(){
	var paramData = $j('#reportForm').serialize();
	var chartByMonth = new FusionCharts("${ctxPath}/fusionCharts/FCF_Line.swf", "chartByMonth", "780", "350");
	var url1 = "${ctxPath}/report/reportData/blank.html?reportName=salesAmountByMonth";
	chartByMonth.setDataURL(escape(url1+"&"+paramData));
	chartByMonth.render("chartdiv");
}

function searchByYear(){
	var paramData = $j('#reportForm').serialize();
	var chartByYear = new FusionCharts("${ctxPath}/fusionCharts/FCF_Line.swf", "chartByYear", "780", "350");
	var url2 = "${ctxPath}/report/reportData/blank.html?reportName=salesAmountByYear";
	chartByYear.setDataURL(escape(url2+"&"+paramData));
	chartByYear.render("chartdiv2");
}
</script>
</verFunc:verFuncValidate>